package org.six.background.controller;

import org.six.background.pojo.User;
import org.six.background.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@RequestMapping("/user")
@ResponseBody
@Controller
public class UserController {
    @Autowired(required = false)
    private UserService userService;
    //登录验证方法
    @RequestMapping("/login")
    public Map login(User user){
        return userService.logintest(user);
    }

    @RequestMapping("/test")
    public Object test(){
        return "okk";
    }

    @RequestMapping("/selectById")
    public Object selectById(Integer usid){
        System.out.println(usid);
        return userService.selectById(usid);
    }
}
